<div class="task-card">
    <div class="task-header">
        <div class="task-header-txt">
            <span>{{title}}</span>
            <span class="task-count">
                <ng-container *ngIf="messages && messages.length">({{messages.length}})</ng-container>
            </span>
        </div>
        <button nz-button nzType="link" nz-popconfirm
            [nzPopconfirmTitle]="redirectPage && redirectPage.pageId ? '确认跳转到页面：'+redirectPage.menuName :''"
            nzPopconfirmOverlayClassName="task-card" (nzOnConfirm)="redirect()">
            <i nz-icon nzType="ellipsis" nzTheme="outline"></i>
        </button>
    </div>
    <div class="task-content">
        <p class="current-date">
            <ng-container *ngIf="messages && messages[currentIndex]&&messages[currentIndex].createTime ">
                {{messages[currentIndex].createTime | date:'yyyy-MM-dd HH:mm'}}
            </ng-container>
        </p>
        <div class="msg-container">
            <div class="msg-wrapper" #msgWrapper>
                <ng-container *ngIf="messages && messages.length">
                    <div class="msg-item" *ngFor="let msg of messages" [innerHTML]="msg.body"> </div>
                </ng-container>
            </div>
        </div>
        <div class="btn-wrapper">
            <button nz-button nzType="link" [disabled]="currentIndex===0 || !this.messages || !this.messages.length"
                (click)="prev()">
                <i nz-icon nzType="left" nzTheme="outline"></i>
            </button>
            <span *ngIf="this.messages && this.messages.length"
                class="location-sign">{{this.currentIndex+1}}/{{this.messages.length}}</span>
            <button nz-button nzType="link"
                [disabled]="currentIndex===(messages.length-1) || !this.messages || !this.messages.length"
                (click)="next()">
                <i nz-icon nzType="right" nzTheme="outline"></i>
            </button>
        </div>
    </div>
</div>